Fix stale MPP APIs and rename Channel mode to Session - #71
Conversation
API fixes, all from the on-chain-verified report in #60 and re-checked against the published packages (mppx exports map and peer deps via npm): - mppx.middleware() does not exist; Mppx.create on the mppx/express adapter returns per-route handlers, and the price is set per route (the old examples never set an amount anywhere) - the bare mppx root exports neither Mppx nor Store; imports now use mppx/express, mppx/server, and mppx/client subpaths, with the package table corrected - charge mode requires a store; the charge server now passes Store.memory() and a pitfall documents the startup error - client progress events are challenge/signing/signed/paying/ confirming/paid with the hash on event.hash, not settled/txHash - install line pins express@^5 and stellar-sdk@^15 with a note on the @stellar/mpp peer-dependency pins and the ERESOLVE failure Terminology per #57: the payment intent is now called Session (channel-backed); Channel stays as the name of the settlement mechanism and as a documented synonym for searchability. Closes #60. Closes #57.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (4)
skills/agentic-payments/SKILL.md:603
- The package-reference install is still unpinned even though this table documents the 0.6.x subpaths. Because
@stellar/mpp@0.7.1requiresmppx@^0.6.29and newer incompatible mppx releases exist, pin this second command too.
| `mppx/express` | `import { Mppx } from "mppx/express"` — Express adapter; `Mppx.create(...)` returns per-route handlers |
skills/agentic-payments/SKILL.md:395
- Pin the compatible MPP pair in this command.
@stellar/mpp@0.7.1declaresmppx@^0.6.29, while an unversionedmppxnow resolves past 0.6.x, so this advertised install can fail withERESOLVEbefore the examples run.
This issue also appears on line 603 of the same file.
npm install express@^5 @stellar/mpp mppx @stellar/stellar-sdk@^15 dotenv
skills/agentic-payments/SKILL.md:3
- The Session rename is not yet repository-wide:
README.md:84still advertisesMPP (Charge + Channel), so the top-level skill index continues presenting Channel as the public mode. Update that entry toCharge + Sessionbefore closing #57.
description: Agentic and machine-to-machine payments on Stellar. Covers x402 (HTTP 402 paid APIs via OZ Channels facilitator, fee-sponsored clients) and MPP (Machine Payments Protocol) in both Charge mode (per-request SAC) and Session mode (channel-backed off-chain commits, high-frequency; formerly called Channel mode). Defaults to USDC (SEP-41 SAC) on `stellar:testnet`/`stellar:pubnet` (CAIP-2). Use when selling a paid API to AI agents, building an x402 client, or designing a payment-channel architecture for high-frequency agent traffic.
skills/agentic-payments/SKILL.md:607
- This warning is inaccurate for the documented
mppx@^0.6.29line: the bare root re-exportsStore, including the usableStore.memory()factory. OnlyMppxis absent there. Keep recommending role-specific subpaths, but do not claim thatStoreis unavailable.
> The bare `mppx` root does **not** export a usable `Mppx` or `Store` — always import from the subpaths above.
|
Re-verified every item in #60 against the published packages before merging. Installed exactly what the skill's install line produces ( The negative controls reproduce #60's findings exactly, which is what makes the clean pass meaningful: Finding 3 reproduces at runtime too — One correction pushed in 385c3ab: the note under the package table claimed the bare Terminology per #57 checks out: the only two remaining "Channel mode" mentions are the deliberate synonym callouts (frontmatter + the naming note), and every other "channel" refers to the settlement mechanism. Site build, lint, and tsc all green. Merging. |
Three scenarios per skill plus cross-skill routing checks and an
off-topic negative control, in the {skills, query, expected_behavior}
format with optional machine_checkable assertions. evals/README.md
documents the tiers (compile checks, LLM-judged behavior, trigger
checks), the baseline process, and how to run a scenario; the root
README links it and documents the 500-line router convention.
Scenario expectations reflect current protocol reality rather than the
July proposal where they diverged: Noir/UltraHonk verifies on-chain
since Protocol 26 (#72), MPP Channel mode is now Session (#71), and
getLedgers depth is provider-retention dependent (#73).
Closes #60. Closes #57.
Applies @jeesunikim's on-chain-verified corrections from #60, each re-checked against the published packages before writing (
npm view mppx@0.6.29 exportsconfirms the subpath map and that the root exports no usableMppx/Store;npm viewconfirms the@stellar/mpp@0.7.1peer pins):mppx.middleware()is gone from both servers.Mppx.createon themppx/expressadapter returns per-route handlers, mounted per paid route with the price set there — the old examples never set an amount anywhere.mppx/express,mppx/server,mppx/client, client re-export via@stellar/mpp/charge/client), and the package table now maps them explicitly with a warning about the bare root.store: Store.memory(), with a new error-keyed pitfall for the startup throw.challenge | signing | signed | paying | confirming | paidwithevent.hash.express@^5/stellar-sdk@^15plus a note on the peer-dependencyERESOLVEfailure, and a matching pitfall.Terminology per #57: the mode is now Session everywhere (decision table, headings, pitfalls, frontmatter, site card), with a naming callout that keeps "Channel mode" as a documented synonym and reserves "channel" for the settlement mechanism — contract, deposit, close flows keep their mechanism wording, as recommended.
Verification: all four examples in the diff type-check exactly as written against the published packages (mppx 0.6.31, @stellar/mpp 0.7.1, stellar-sdk 15.1.0, express 5.2.1), including the session server's per-route
mppx.channel({ amount, description })handler. A negative control confirms the types are real rather thanany:mppx.middleware()fails with property-does-not-exist, a typo'd route option is rejected with the exact{ amount, description, expires, meta, scope }schema, and comparing an event to"settled"fails against the realchallenge | signing | signed | paying | confirming | paidunion — the compiler reproduces #60's findings verbatim.